# eric7.Plugins.VcsPlugins.vcsGit.GitLogBrowserDialog

Module implementing a dialog to browse the log history.

### Global Attributes

COLORNAMES
COLORS
LIGHTCOLORS

### Classes

GitLogBrowserDialog | Class implementing a dialog to browse the log history.

### Functions

None

## GitLogBrowserDialog

Class implementing a dialog to browse the log history.

### Derived from

QWidget, Ui_GitLogBrowserDialog

### Class Attributes

AuthorColumn
BranchColumn
CommitDateColumn
CommitIdColumn
CommitterColumn
DateColumn
IconColumn
SubjectColumn
TagsColumn

### Class Methods

None

### Methods

GitLogBrowserDialog | Constructor
__actionMode | Private method to get the selected action mode.
__addFinishCallback | Private method to add a method to be called once the process finished.
__branchActTriggered | Private slot to create a new branch starting at the selected commit.
__branchSwitchActTriggered | Private slot to create a new branch starting at the selected commit and switch the work tree to it.
__cherryActTriggered | Private slot to handle the Copy Commits action.
__commitIdClicked | Private slot to handle the anchorClicked signal of the changeset details pane.
__describeActTriggered | Private slot to show the most recent tag reachable from a commit.
__filterLogs | Private method to filter the log entries.
__findItem | Private slot to find an item matching the entered criteria.
__finish | Private slot called when the process finished or the user pressed the button.
__generateDetailsTableText | Private method to generate an HTML table with the details of the given changeset.
__generateDiffs | Private slot to generate diff outputs for the selected item.
__generateEdges | Private method to generate edge info for the give data.
__generateFileItem | Private method to generate a changed files tree entry.
__generateIcon | Private method to generate an icon containing the revision tree for the given data.
__generateLogItem | Private method to generate a log tree entry.
__generatorFinished | Private slot connected to the finished signal of the diff generator.
__getBranchesForCommit | Private method to get all branches reachable from a commit ID.
__getColor | Private method to get the (rotating) name of the color given an index.
__getCommitForTag | Private method to get the commit id for a tag.
__getLogEntries | Private method to retrieve log entries from the repository.
__getTagsForCommit | Private method to get all tags reachable from a commit ID.
__identifyProject | Private method to determine the revision of the project directory.
__initActionsMenu | Private method to initialize the actions menu.
__initData | Private method to (re-)initialize some data.
__initLogTreeContextMenu | Private method to initialize the log tree context menu.
__mergeFileSeparators | Private method to merge the file separator entries.
__prepareFieldSearch | Private slot to prepare the filed search data.
__procFinished | Private slot connected to the finished signal.
__processBuffer | Private method to process the buffered output of the git log command.
__processBufferItem | Private method to process a log entry.
__readStderr | Private slot to handle the readyReadStandardError signal.
__readStdout | Private slot to handle the readyReadStandardOutput signal.
__reloadGeometry | Private method to restore the geometry.
__resetUI | Private method to reset the user interface.
__resizeColumnsFiles | Private method to resize the changed files tree columns.
__resizeColumnsLog | Private method to resize the log tree columns.
__resortFiles | Private method to resort the changed files tree.
__restoreSplitterStates | Private method to restore the state of the various splitters.
__shortlogActTriggered | Private slot to show a short log suitable for release announcements.
__showAuthorColumns | Private slot to show/hide the committer columns.
__showBranchesColumn | Private slot to show/hide the branches column.
__showCommitIdColumn | Private slot to show/hide the commit ID column.
__showCommitterColumns | Private slot to show/hide the committer columns.
__showError | Private slot to show some error.
__showTagsColumn | Private slot to show/hide the tags column.
__switchActTriggered | Private slot to switch the working directory to the selected commit.
__tagActTriggered | Private slot to tag the selected commit.
__updateDetailsAndFiles | Private slot to update the details and file changes panes.
__updateFilesTree | Private method to update the files tree with changes of the given item.
__updateSbsSelectLabel | Private slot to update the enabled status of the diff buttons.
__updateToolMenuActions | Private slot to update the status of the tool menu actions and the tool menu button.
closeEvent | Protected slot implementing a close event handler.
col2x | Local function to calculate a x-position for a column.
keyPressEvent | Protected slot to handle a key press event.
on_buttonBox_clicked | Private slot called by a button of the button box clicked.
on_diffSelectLabel_linkActivated | Private slot to handle the selection of a diff target.
on_downButton_clicked | Private slot to move the current item down one entry.
on_fieldCombo_activated | Private slot called, when a new filter field is selected.
on_filesTree_currentItemChanged | Private slot called, when the current item of the files tree changes.
on_findNextButton_clicked | Private slot to find the next item matching the entered criteria.
on_findPrevButton_clicked | Private slot to find the previous item matching the entered criteria.
on_fromDate_dateChanged | Private slot called, when the from date changes.
on_input_returnPressed | Private slot to handle the press of the return key in the input field.
on_logTree_currentItemChanged | Private slot called, when the current item of the log tree changes.
on_logTree_customContextMenuRequested | Private slot to show the context menu of the log tree.
on_logTree_itemSelectionChanged | Private slot called, when the selection has changed.
on_modeComboBox_currentIndexChanged | Private slot to react on mode changes.
on_nextButton_clicked | Private slot to handle the Next button.
on_passwordCheckBox_toggled | Private slot to handle the password checkbox toggled.
on_refreshButton_clicked | Private slot to refresh the log.
on_rxEdit_returnPressed | Private slot handling a press of the Return key in the rxEdit input.
on_rxEdit_textChanged | Private slot called, when a filter expression is entered.
on_saveLabel_linkActivated | Private slot to handle the selection of the save link.
on_sbsSelectLabel_linkActivated | Private slot to handle selection of a side-by-side link.
on_sendButton_clicked | Private slot to send the input to the git process.
on_stopCheckBox_clicked | Private slot called, when the stop on copy/move checkbox is clicked.
on_toDate_dateChanged | Private slot called, when the from date changes.
on_upButton_clicked | Private slot to move the current item up one entry.
show | Public slot to show the dialog.
start | Public slot to start the git log command.

### Static Methods

None

#### GitLogBrowserDialog (Constructor)

GitLogBrowserDialog(vcs, parent=None)

Constructor

vcs (Git)
  reference to the vcs object
parent (QWidget)
  parent widget

#### GitLogBrowserDialog.__actionMode

__actionMode()

Private method to get the selected action mode.

Return:
  selected action mode (one of 'filter' or 'find')

Return Type:
  str

#### GitLogBrowserDialog.__addFinishCallback

__addFinishCallback(callback)

Private method to add a method to be called once the process finished.

The callback methods are invoke in a FIFO style and are consumed. If a callback method needs to be called again, it must be added again.

callback (function)
  callback method

#### GitLogBrowserDialog.__branchActTriggered

__branchActTriggered()

Private slot to create a new branch starting at the selected commit.

#### GitLogBrowserDialog.__branchSwitchActTriggered

__branchSwitchActTriggered()

Private slot to create a new branch starting at the selected commit and switch the work tree to it.

#### GitLogBrowserDialog.__cherryActTriggered

__cherryActTriggered()

Private slot to handle the Copy Commits action.

#### GitLogBrowserDialog.__commitIdClicked

__commitIdClicked(url)

Private slot to handle the anchorClicked signal of the changeset details pane.

url (QUrl)
  URL that was clicked

#### GitLogBrowserDialog.__describeActTriggered

__describeActTriggered()

Private slot to show the most recent tag reachable from a commit.

#### GitLogBrowserDialog.__filterLogs

__filterLogs()

Private method to filter the log entries.

#### GitLogBrowserDialog.__findItem

__findItem(backwards=False, interactive=False)

Private slot to find an item matching the entered criteria.

backwards (bool)
  flag indicating to search backwards
interactive (bool)
  flag indicating an interactive search

#### GitLogBrowserDialog.__finish

__finish()

Private slot called when the process finished or the user pressed the button.

#### GitLogBrowserDialog.__generateDetailsTableText

__generateDetailsTableText(itm)

Private method to generate an HTML table with the details of the given changeset.

itm (QTreeWidgetItem)
  reference to the item the table should be based on

Return:
  HTML table containing details

Return Type:
  str

#### GitLogBrowserDialog.__generateDiffs

__generateDiffs(parent=1)

Private slot to generate diff outputs for the selected item.

parent (int)
  number of parent to diff against

#### GitLogBrowserDialog.__generateEdges

__generateEdges(commitId, parents)

Private method to generate edge info for the give data.

commitId (str)
  commit id to calculate edge info for
parents (list of str)
  list of parent commits

Return:
  tuple containing the column and color index for the given node and a list of tuples indicating the edges between the given node and its parents

Return Type:
  tuple of (int, int, [(int, int, int), ...])

#### GitLogBrowserDialog.__generateFileItem

__generateFileItem(action, path, copyfrom, additions, deletions)

Private method to generate a changed files tree entry.

action (str)
  indicator for the change action ("A", "C", "D", "M", "R", "T", "U", "X")
path (str)
  path of the file in the repository
copyfrom (str)
  path the file was copied from
additions (int)
  number of added lines
deletions (int)
  number of deleted lines

Return:
  reference to the generated item

Return Type:
  QTreeWidgetItem

#### GitLogBrowserDialog.__generateIcon

__generateIcon(column, bottomedges, topedges, dotColor, currentCommit)

Private method to generate an icon containing the revision tree for the given data.

column (int)
  column index of the revision
bottomedges (list of [(int, int, int)])
  list of edges for the bottom of the node
topedges (list of [(int, int, int)])
  list of edges for the top of the node
dotColor (QColor)
  color to be used for the dot
currentCommit (bool)
  flag indicating to draw the icon for the current commit

Return:
  icon for the node

Return Type:
  QIcon

#### GitLogBrowserDialog.__generateLogItem

__generateLogItem(author, date, committer, commitDate, subject, message, commitId, fullCommitId, changedPaths, parents, refnames, authorMail, committerMail, )

Private method to generate a log tree entry.

author (str)
  author info
date (str)
  date info
committer (str)
  committer info
commitDate (str)
  commit date info
subject (str)
  subject of the log entry
message (list of str)
  text of the log message
commitId (str)
  commit id info
fullCommitId (str)
  unabbreviated commit id info
changedPaths (list of dict)
  list of dictionary objects containing info about the changed files/directories
parents (list of int)
  list of parent revisions
refnames (str)
  tags and branches of the commit
authorMail (str)
  author's email address
committerMail (str)
  committer's email address

Return:
  reference to the generated item

Return Type:
  QTreeWidgetItem

#### GitLogBrowserDialog.__generatorFinished

__generatorFinished()

Private slot connected to the finished signal of the diff generator.

#### GitLogBrowserDialog.__getBranchesForCommit

__getBranchesForCommit(commitId)

Private method to get all branches reachable from a commit ID.

commitId (str)
  commit ID to get the branches for

Return:
  list of tuples containing the branch name and the associated commit ID of its branch head

Return Type:
  tuple of (str, str)

#### GitLogBrowserDialog.__getColor

__getColor(n)

Private method to get the (rotating) name of the color given an index.

n (int)
  color index

Return:
  color name

Return Type:
  str

#### GitLogBrowserDialog.__getCommitForTag

__getCommitForTag(tag)

Private method to get the commit id for a tag.

tag (str)
  tag name

Return:
  commit id shortened to 10 characters

Return Type:
  str

#### GitLogBrowserDialog.__getLogEntries

__getLogEntries(skip=0, noEntries=0)

Private method to retrieve log entries from the repository.

skip (int)
  number of log entries to skip
noEntries (int)
  number of entries to get (0 = default)

#### GitLogBrowserDialog.__getTagsForCommit

__getTagsForCommit(commitId)

Private method to get all tags reachable from a commit ID.

commitId (str)
  commit ID to get the tags for

Return:
  list of tuples containing the tag name and the associated commit ID

Return Type:
  tuple of (str, str)

#### GitLogBrowserDialog.__identifyProject

__identifyProject()

Private method to determine the revision of the project directory.

#### GitLogBrowserDialog.__initActionsMenu

__initActionsMenu()

Private method to initialize the actions menu.

#### GitLogBrowserDialog.__initData

__initData()

Private method to (re-)initialize some data.

#### GitLogBrowserDialog.__initLogTreeContextMenu

__initLogTreeContextMenu()

Private method to initialize the log tree context menu.

#### GitLogBrowserDialog.__mergeFileSeparators

__mergeFileSeparators(fileSeparators)

Private method to merge the file separator entries.

fileSeparators (list of str)
  list of file separator entries to be merged

Return:
  merged list of file separator entries

Return Type:
  list of str

#### GitLogBrowserDialog.__prepareFieldSearch

__prepareFieldSearch()

Private slot to prepare the filed search data.

Return:
  tuple of field index, search expression and flag indicating that the field index is a data role

Return Type:
  tuple of (int, str, bool)

#### GitLogBrowserDialog.__procFinished

__procFinished(_exitCode, _exitStatus)

Private slot connected to the finished signal.

_exitCode (int)
  exit code of the process (unused)
_exitStatus (QProcess.ExitStatus)
  exit status of the process (unused)

#### GitLogBrowserDialog.__processBuffer

__processBuffer()

Private method to process the buffered output of the git log command.

#### GitLogBrowserDialog.__processBufferItem

__processBufferItem(logEntry)

Private method to process a log entry.

logEntry (dict)
  dictionary as generated by __processBuffer

#### GitLogBrowserDialog.__readStderr

__readStderr()

Private slot to handle the readyReadStandardError signal.

It reads the error output of the process and inserts it into the error pane.

#### GitLogBrowserDialog.__readStdout

__readStdout()

Private slot to handle the readyReadStandardOutput signal.

It reads the output of the process and inserts it into a buffer.

#### GitLogBrowserDialog.__reloadGeometry

__reloadGeometry()

Private method to restore the geometry.

#### GitLogBrowserDialog.__resetUI

__resetUI()

Private method to reset the user interface.

#### GitLogBrowserDialog.__resizeColumnsFiles

__resizeColumnsFiles()

Private method to resize the changed files tree columns.

#### GitLogBrowserDialog.__resizeColumnsLog

__resizeColumnsLog()

Private method to resize the log tree columns.

#### GitLogBrowserDialog.__resortFiles

__resortFiles()

Private method to resort the changed files tree.

#### GitLogBrowserDialog.__restoreSplitterStates

__restoreSplitterStates()

Private method to restore the state of the various splitters.

#### GitLogBrowserDialog.__shortlogActTriggered

__shortlogActTriggered()

Private slot to show a short log suitable for release announcements.

#### GitLogBrowserDialog.__showAuthorColumns

__showAuthorColumns(on)

Private slot to show/hide the committer columns.

on (bool)
  flag indicating the selection state

#### GitLogBrowserDialog.__showBranchesColumn

__showBranchesColumn(on)

Private slot to show/hide the branches column.

on (bool)
  flag indicating the selection state

#### GitLogBrowserDialog.__showCommitIdColumn

__showCommitIdColumn(on)

Private slot to show/hide the commit ID column.

on (bool)
  flag indicating the selection state

#### GitLogBrowserDialog.__showCommitterColumns

__showCommitterColumns(on)

Private slot to show/hide the committer columns.

on (bool)
  flag indicating the selection state

#### GitLogBrowserDialog.__showError

__showError(out)

Private slot to show some error.

out (str)
  error to be shown

#### GitLogBrowserDialog.__showTagsColumn

__showTagsColumn(on)

Private slot to show/hide the tags column.

on (bool)
  flag indicating the selection state

#### GitLogBrowserDialog.__switchActTriggered

__switchActTriggered()

Private slot to switch the working directory to the selected commit.

#### GitLogBrowserDialog.__tagActTriggered

__tagActTriggered()

Private slot to tag the selected commit.

#### GitLogBrowserDialog.__updateDetailsAndFiles

__updateDetailsAndFiles()

Private slot to update the details and file changes panes.

#### GitLogBrowserDialog.__updateFilesTree

__updateFilesTree(itm)

Private method to update the files tree with changes of the given item.

itm (QTreeWidgetItem)
  reference to the item the update should be based on

#### GitLogBrowserDialog.__updateSbsSelectLabel

__updateSbsSelectLabel()

Private slot to update the enabled status of the diff buttons.

#### GitLogBrowserDialog.__updateToolMenuActions

__updateToolMenuActions()

Private slot to update the status of the tool menu actions and the tool menu button.

#### GitLogBrowserDialog.closeEvent

closeEvent(e)

Protected slot implementing a close event handler.

e (QCloseEvent)
  close event

#### GitLogBrowserDialog.col2x

col2x(radius)

Local function to calculate a x-position for a column.

col (int)
  column number
radius (int)
  radius of the indicator circle

#### GitLogBrowserDialog.keyPressEvent

keyPressEvent(evt)

Protected slot to handle a key press event.

evt (QKeyEvent)
  the key press event

#### GitLogBrowserDialog.on_buttonBox_clicked

on_buttonBox_clicked(button)

Private slot called by a button of the button box clicked.

button (QAbstractButton)
  button that was clicked

#### GitLogBrowserDialog.on_diffSelectLabel_linkActivated

on_diffSelectLabel_linkActivated(link)

Private slot to handle the selection of a diff target.

link (str)
  activated link

#### GitLogBrowserDialog.on_downButton_clicked

on_downButton_clicked()

Private slot to move the current item down one entry.

#### GitLogBrowserDialog.on_fieldCombo_activated

on_fieldCombo_activated(index)

Private slot called, when a new filter field is selected.

index (int)
  index of the selected entry

#### GitLogBrowserDialog.on_filesTree_currentItemChanged

on_filesTree_currentItemChanged(current, previous)

Private slot called, when the current item of the files tree changes.

current (QTreeWidgetItem)
  reference to the new current item
previous (QTreeWidgetItem)
  reference to the old current item

#### GitLogBrowserDialog.on_findNextButton_clicked

on_findNextButton_clicked()

Private slot to find the next item matching the entered criteria.

#### GitLogBrowserDialog.on_findPrevButton_clicked

on_findPrevButton_clicked()

Private slot to find the previous item matching the entered criteria.

#### GitLogBrowserDialog.on_fromDate_dateChanged

on_fromDate_dateChanged(date)

Private slot called, when the from date changes.

date (QDate)
  new date

#### GitLogBrowserDialog.on_input_returnPressed

on_input_returnPressed()

Private slot to handle the press of the return key in the input field.

#### GitLogBrowserDialog.on_logTree_currentItemChanged

on_logTree_currentItemChanged(current, previous)

Private slot called, when the current item of the log tree changes.

current (QTreeWidgetItem)
  reference to the new current item
previous (QTreeWidgetItem)
  reference to the old current item

#### GitLogBrowserDialog.on_logTree_customContextMenuRequested

on_logTree_customContextMenuRequested(pos)

Private slot to show the context menu of the log tree.

pos (QPoint)
  position of the mouse pointer

#### GitLogBrowserDialog.on_logTree_itemSelectionChanged

on_logTree_itemSelectionChanged()

Private slot called, when the selection has changed.

#### GitLogBrowserDialog.on_modeComboBox_currentIndexChanged

on_modeComboBox_currentIndexChanged(index)

Private slot to react on mode changes.

index (int)
  index of the selected entry

#### GitLogBrowserDialog.on_nextButton_clicked

on_nextButton_clicked()

Private slot to handle the Next button.

#### GitLogBrowserDialog.on_passwordCheckBox_toggled

on_passwordCheckBox_toggled(isOn)

Private slot to handle the password checkbox toggled.

isOn (bool)
  flag indicating the status of the check box

#### GitLogBrowserDialog.on_refreshButton_clicked

on_refreshButton_clicked()

Private slot to refresh the log.

#### GitLogBrowserDialog.on_rxEdit_returnPressed

on_rxEdit_returnPressed()

Private slot handling a press of the Return key in the rxEdit input.

#### GitLogBrowserDialog.on_rxEdit_textChanged

on_rxEdit_textChanged(txt)

Private slot called, when a filter expression is entered.

txt (str)
  filter expression

#### GitLogBrowserDialog.on_saveLabel_linkActivated

on_saveLabel_linkActivated(link)

Private slot to handle the selection of the save link.

link (str)
  activated link

#### GitLogBrowserDialog.on_sbsSelectLabel_linkActivated

on_sbsSelectLabel_linkActivated(link)

Private slot to handle selection of a side-by-side link.

link (str)
  text of the selected link

#### GitLogBrowserDialog.on_sendButton_clicked

on_sendButton_clicked()

Private slot to send the input to the git process.

#### GitLogBrowserDialog.on_stopCheckBox_clicked

on_stopCheckBox_clicked(_checked)

Private slot called, when the stop on copy/move checkbox is clicked.

_checked (bool)
  flag indicating the state of the check box (unused)

#### GitLogBrowserDialog.on_toDate_dateChanged

on_toDate_dateChanged(date)

Private slot called, when the from date changes.

date (QDate)
  new date

#### GitLogBrowserDialog.on_upButton_clicked

on_upButton_clicked()

Private slot to move the current item up one entry.

#### GitLogBrowserDialog.show

show()

Public slot to show the dialog.

#### GitLogBrowserDialog.start

start(fn, isFile=False, noEntries=0)

Public slot to start the git log command.

fn (str)
  filename to show the log for
isFile (bool)
  flag indicating log for a file is to be shown
noEntries (int)
  number of entries to get (0 = default)

Up